/**
 * Unicorn Admin Template
 * Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
	
	$('input[type=checkbox],input[type=radio],input[type=file]').unicontrol();
	
	$('select').select2();
	
	// control Validation

	if (jQuery().validate) {
	    var l = function (e) {
	        $(e).closest(".control-group").removeClass("has-success")
	    };
	    $(".validationcontrol").validate({
	        errorElement: "span",
	        errorClass: "help-block",
	        focusInvalid: false,
	        ignore: "",
	        invalidHandler: function (e, t) { },
	        highlight: function (e) {
	            $(e).closest(".control-group").removeClass("has-success").addClass("has-error")
	        },
	        unhighlight: function (e) {
	            $(e).closest(".control-group").removeClass("has-error");
	            setTimeout(function () { l(e) }, 3e3)
	        },
	        success: function (e) {
	            e.closest(".control-group").removeClass("has-error").addClass("has-success")
	        }
	    })
	}

});
